package jpa.entity;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * Created by barton on 16-5-12.
 */
@Entity
//@EntityListeners(AuditingEntityListener.class)
public class AuditableUser {
    @Id
    @GeneratedValue
    private Long id;
    private String username;

//    @CreatedDate
//    private LocalDateTime createdDate;
//    @LastModifiedDate
//    private LocalDateTime lastModifiedDate;
//
//    @ManyToOne
//    @CreatedBy
//    private AuditableUser createdBy;
//
//    @ManyToOne
//    @LastModifiedBy
//    private AuditableUser lastModifiedBy;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

//    public LocalDateTime getCreatedDate() {
//        return createdDate;
//    }
//
//    public void setCreatedDate(LocalDateTime createdDate) {
//        this.createdDate = createdDate;
//    }
//
//    public LocalDateTime getLastModifiedDate() {
//        return lastModifiedDate;
//    }
//
//    public void setLastModifiedDate(LocalDateTime lastModifiedDate) {
//        this.lastModifiedDate = lastModifiedDate;
//    }
//
//    public AuditableUser getCreatedBy() {
//        return createdBy;
//    }
//
//    public void setCreatedBy(AuditableUser createdBy) {
//        this.createdBy = createdBy;
//    }
//
//    public AuditableUser getLastModifiedBy() {
//        return lastModifiedBy;
//    }
//
//    public void setLastModifiedBy(AuditableUser lastModifiedBy) {
//        this.lastModifiedBy = lastModifiedBy;
//    }
}
